home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / programming / c / turbotext / sclib_guide.ttx < prev    next >
Encoding:
Text File  |  1978-11-24  |  1.1 KB  |  50 lines

  1. /** $VER: sclib_guide 1.0 (15.2.93)
  2.  **
  3.  ** A simple TTX interface to SAS/C library documentation.
  4.  **
  5.  ** Written by Kari Sutela
  6.  **/
  7.  
  8. options results
  9. 'GetWord'
  10. if result = '' then do
  11.     'SetStatusBar No current word'
  12.     exit
  13. end
  14. word = result
  15. /* First try 'word()' */
  16. function = word || '()'
  17. if ~moveto(function) then do
  18.     /* Didn't work, try word by itself (might be a data item) */
  19.     if ~moveto(word) then do
  20.         'SetStatusBar "'word'" not documented'
  21.     end
  22. end
  23. exit
  24.  
  25. moveto: PROCEDURE
  26.     parse arg word
  27.  
  28.     oldaddr = address()
  29.     /* Is the "correct" amigaguide already running? */
  30.     if ~show('Ports','AMIGAGUIDE.LIB') then do
  31.         /* Nope.  Try to run it */
  32.         address command 'run <nil: >nil: sc:c/amigaguide <nil: >nil: sc:help/sc_lib.guide portname AMIGAGUIDE.LIB'
  33.         if rc ~= 0 then do
  34.             'SetStatusBar Unable to load amigaguide'
  35.             exit
  36.         end
  37.         address command 'WaitForPort AMIGAGUIDE.LIB'
  38.         if rc ~= 0 then do
  39.             'SetStatusBar Unable to load amigaguide'
  40.             exit
  41.         end
  42.     end
  43.     /* Now it is! */
  44.     address AMIGAGUIDE.LIB
  45.     'link' word
  46.     success = (rc = 0)
  47.     address value oldaddr
  48.     if success then 'ActivateWindow'
  49.     return success
  50.